<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="en" style="overflow:hidden;">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
	<title><?php echo ($title); ?></title>
	<link rel="stylesheet" href="/ranking/Public/Mobile/css/style.css" />
	<script src="/ranking/Public/Static/js/jquery.js"></script>
	<script src="/ranking/Public/Mobile/js/scroll.js"></script>
	
</head>
<body style="background-color:#c31e26;">
	<div class="container">
			<div class="mobile-logo">
				<img src="<?php echo ($path); ?>" alt="" />
			</div>

			<div class="home-content">
				<div class="home-article">
				<?php echo (html_entity_decode($article["content"])); ?>
				</div>
			</div>

			<div class="full-runking">
				<div class="title">
					<h3>捐款人</h3>
					<h3>金额</h3>
				</div>
				<div id="page" class="content-runking">
					<ul>
						<?php if(is_array($data)): foreach($data as $key=>$vo): ?><li>
							<div><?php echo (ReStrLen($vo["nickname"],5)); ?></div>
							<div>￥<?php echo ($vo["money"]); ?></div>
						</li><?php endforeach; endif; ?>
					</ul>
				</div>
			</div>
	</div>

<div id="lanren">
<div id="audio-btn" class="on" onclick="lanren.changeClass(this,'media')">
	<!-- <audio loop="loop" src="<?php echo ($music); ?>" id="media" preload="preload"></audio> -->
</div>
</div>
<div class="video-play"><img src="/ranking/Public/Mobile/images/video-play.png" alt=""></div>
<div class="video">
	<video controls src="/ranking/Public/Static/images/v.mp4"></video>
</div>

<script src='/ranking/Public/Mobile/js/blooming-menu.min.js'></script>
<script>
	$(function(){

	    var bloomingMenu = new BloomingMenu({
	      startAngle: -90,
	      endAngle: 0,
	      radius: 100,
	      itemsNum: 4,
	      itemAnimationDelay: 0.08
	    })
	    bloomingMenu.render();

		bloomingMenu.props.elements.items.forEach(function (item, index) {
		  item.addEventListener('click', function () {
		    // window.location.href="http://m.baidu.com";
		    //console.log('Item #' + index + 'was clicked')
		    	console.log(index);
		    	switch(index) {
		    		case 0:
		    			window.location.href="<?php echo U('Index/index');?>";
		    			break;
		    		case 1:
		    			window.location.href="<?php echo U('Index/search');?>";
		    			break;
		    		case 2:
		    			window.location.href="<?php echo U('Article/index');?>?id=9";
		    			break;
		    		case 3:
		    			window.location.href="<?php echo U('Article/index');?>?id=10";
		    			break;
		    	}
		  })
		});

		$(".blooming-menu__container .blooming-menu__item-btn-wrapper .blooming-menu__item-btn:eq(0)").html('首页');
		$(".blooming-menu__container .blooming-menu__item-btn-wrapper .blooming-menu__item-btn:eq(1)").html('搜索');
		$(".blooming-menu__container .blooming-menu__item-btn-wrapper .blooming-menu__item-btn:eq(2)").html('捐款方式');
		$(".blooming-menu__container .blooming-menu__item-btn-wrapper .blooming-menu__item-btn:eq(3)").html('春祭简介');
	});
</script>

<script>
$(function(){
	$('#page').myScroll({
        speed: 44, //数值越大，速度越慢
        rowHeight: 50 //li的高度
    });

    $("body").click(function(){
    	$(".video").hide();
    	$('.video video').trigger('pause');
    });
    $(".video-play").click(function(event){
    	$(".video").show();
    	event.stopPropagation();
    });

    $(".video").click(function(event){
    	event.stopPropagation();
    })

});
	//接收服务消息
	// $(function(){
	//   var url='ws://192.168.2.11:8000';
	//   socket=new WebSocket(url);
	//   socket.onopen=function(){log('连接成功')}
	//   socket.onmessage=function(msg){log2('获得消息:'+msg.data);console.log(msg);}
	//   socket.onclose=function(){log('断开连接')}
	// });
	// function log(var1){
	//   //alert(1);
	// }
	// function log2(var1){
	//   location.reload();
	// }

	var lanren = {
		changeClass: function (target,id) {
	       	var className = $(target).attr('class');
	       	var ids = document.getElementById(id);
	       	(className == 'on')
	           	? $(target).removeClass('on').addClass('off')
	           	: $(target).removeClass('off').addClass('on');
	       	(className == 'on')
	           	? ids.pause()
	           	: ids.play();
	   	},
		play:function(){
			document.getElementById('media').play();
		}
	}
	lanren.play();
</script>
</body>
</html>